import json

from flask import request, jsonify, session
from flask_restful import Resource


class LoginApi(Resource):
    def post(self):
        s1 = session.get("animal")
        print(s1)
        name = request.json.get('name')
        password = request.json.get('password')
        session["animal"]= "长颈鹿12"
        print(session)
        print(str(session))
        return jsonify({"errno":"用户名%s已获取,密码%s已获取"%(name,password)})